<template>
  <div class="select-dialog">
    <el-dialog
        title="创建分组"
        :visible.sync="visible"
        width="54%"
        :before-close="onClose">
        <div slot="title" style="font-size: 14px;font-weight: 500;">
          选择企微号
        </div>
        <div class="check-company-wrap">
          <div class="select-box">
            <div class="search-rows">
              <el-input class="search-input" size="small" placeholder="搜手机号" suffix-icon="el-icon-search" />
              <el-select v-model="value" filterable placeholder="分组" size="small">
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
              <el-select v-model="value" filterable placeholder="任务状态" size="small">
                <el-option
                  v-for="item in statuses"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </div>
            <div class="company-account-list">
              <div class="account-sub-list">
                <div class="sub-head">
                  <div class="title">
                    <el-checkbox />
                    <span style="margin-left: 8px;">全选本页</span>
                  </div>
                  <el-button type="primary" plain size="mini">全选所有</el-button>
                </div>
                <div class="list-box">
                  <div class="list-item" v-for="i in 4" :key="i">
                    <div class="account">
                      <el-checkbox />
                      <div class="company-account">
                        <img class="account-cover" src="https://wework.qpic.cn/wwpic/177031_HhrnVYv6QQSgQ2C_1686909054/0" />
                        <div class="account-info">
                          <div class="name">闵雨微</div>
                          <div class="desc">@志新</div>
                        </div>
                      </div>
                    </div>
                    <div class="task-status">
                      <span class="round gery" />
                      <span>离线</span>
                    </div>
                  </div>
                </div>
              </div>
              <div class="account-sub-list">
                <div class="sub-head">
                  <div class="title">已选择</div>
                  <div class="clear-all">清空</div>
                </div>
                <div class="check-box-list">
                  <div class="check-box-item">
                    <div class="nickname">闵雨微</div>
                    <i class="el-icon-remove-outline"></i>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="record-box">
            <div class="record-wrap">
              <div class="record-title">应用记录</div>
              <div class="record-item">
                <div class="rows-space-between">
                  <span class="title">肖成红</span>
                  <span class="checked">选择</span>
                </div>
                <div class="rows-space-between">
                  <span class="status">
                    <span class="round green"></span>
                    已完成
                  </span>
                  <span class="datetime">2024-02-23 09:43:28</span>
                </div>
              </div>
            </div>
          </div>
        </div>
        <span slot="footer" class="dialog-footer">
          <el-button @click="onClose">取消</el-button>
          <el-button type="primary" @click="onClose">保存</el-button>
        </span>
      </el-dialog>
  </div>
</template>
<script>
export default {
  data() {
    return {
      form: {
        group_name: ''
      },
      options: [{
        value: 1,
        label: '未分组'
      }, {
        value: 2,
        label: '测试分组1'
      }, {
        value: 3,
        label: '测试分组2'
      }],
      statuses: [{
        value: 1,
        label: '开启'
      }, {
        value: 2,
        label: '关闭'
      }],
    }
  },
  props: ['visible'],
  methods: {
    onClose() {
      this.$emit('handCloseDialog');
    }
  },
}
</script>
<style lang="scss" scoped>
.check-company-wrap {
  display: flex;
  .select-box {
    flex: 1 1;
    .search-rows {
      padding: 12px;
      display: grid;
      column-gap: 8px;
      grid-template-columns: 200px 100px 100px;
    }
    .company-account-list {
      display: grid;
      grid-template-columns: 460px 200px;
      .account-sub-list {
        &:not(:first-child) {
          border-left: 1px solid #ececec;
        }
        .sub-head {
          flex: 1 1;
          display: flex;
          align-items: center;
          justify-content: space-between;
          background: #fafafa;
          border-bottom: 1px solid #e9e9e9;
          padding: 0 16px;
          min-height: 48px;
          .title {
            font-weight: 600;
            color: rgba(0, 0, 0, .85);
            span {
              font-weight: 400;
            }
          }
          .clear-all {
            color: #3070ff;
          }
        }
        .list-box {
          .list-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 16px;
            &.check-box {
              background: #eff3ff;
            }
            &:hover {
              background: #eff3ff;
            }
            .account {
              display: flex;
              align-items: center;
              .company-account {
                display: flex;
                align-items: center;
                margin-left: 8px;
                .account-cover {
                  width: 40px;
                  height: 40px;
                }
                .account-info {
                  margin-left: 8px;
                  .name {
                    font-size: 14px;
                    line-height: 22px;
                    color: #222333;
                  }
                  .desc {
                    color: #f08b00;
                    line-height: 22px;
                  }
                }
                .accept-account {
                  font-size: 14px;
                  line-height: 22px;
                }
              }
            }
            .task-status {
              display: flex;
              align-items: center;
              font-size: 14px;
              line-height: 22px;
              .round {
                display: block;
                width: 8px;
                height: 8px;
                border-radius: 50%;
                margin-right: 4px;
                &.open {
                  background: #52c41a;
                }
                &.gery {
                  background: #d9d9d9;
                }
              }
            }
          }
        }
        .check-box-list {
          padding: 12px;
          font-size: 14px;
          line-height: 22px;
          .check-box-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px;
            color: rgba(0,0,0,.85);
          }
        }
      }
    }
  }
  .record-box {
    border-left: 1px solid #ececec;
    width: 312px;
    height: 600px;
    .record-wrap {
      padding: 16px;
      .record-title {
        font-size: 14px;
        font-weight: 600;
        color: rgba(0, 0, 0, .85);
        margin-bottom: 12px;
      }
      .record-item {
        position: relative;
        padding: 12px;
        background: #f7f7f7;
        border-radius: 4px;
        margin-bottom: 8px;
        .rows-space-between {
          display: flex;
          align-items: center;
          justify-content: space-between;
          font-size: 14px;
          line-height: 22px;
          &:not(:first-child) {
            margin-top: 16px;
          }
          .title {
            color: rgba(0, 0, 0, .85);
          }
          .checked {
            color: #3070ff;
          }
          .status {
            display: flex;
            align-items: center;
            font-size: 12px;
            .round {
              display: block;
              width: 6px;
              height: 6px;
              border-radius: 50%;
              margin-right: 4px;
              &.green {
                background: #52c41a;
              }
            }
          }
          .datetime {
            font-size: 12px;
            font-weight: 400;
            color: rgba(0, 0, 0, .45);
          }
        }
      }
    }
  }
}
</style>
<style>
.select-dialog .el-dialog__body {
  padding: 0px;
  font-size: 14px;
}
</style>